package com.itany.shop.service.impl;

import com.itany.shop.dao.ProductDao;
import com.itany.shop.entity.Product;
import com.itany.shop.factory.ObjectFactory;
import com.itany.shop.service.ProductService;

import java.util.List;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public class ProductServiceImpl implements ProductService {
    private ProductDao productDao = (ProductDao) ObjectFactory.getObject("productDao");

    @Override
    public List<Product> findAll() {
        return productDao.selectAll();
    }

    @Override
    public List<Product> findPage(String pageNo, String pageSize) {
        return productDao.selectPage(pageNo, pageSize);
    }

    @Override
    public Product findById(Integer id) {
        return productDao.selectById(id);
    }
}